import 'package:application_with_bilibili/MyFont.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Namer App',
      theme: ThemeData(
        useMaterial3: true,
        colorScheme: ColorScheme.fromSeed(
            seedColor: const Color.fromARGB(255, 255, 3, 3)),
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text(
            '宝可梦大集结',
            style: TextStyle(
              color: Color.fromARGB(255, 255, 0, 0),
              fontSize: 24,
            ),
          ),
          backgroundColor: Color.fromARGB(255, 255, 255, 255),
        ),
        body: MyBody(),
      ),
    );
  }
}

class MyBody extends StatelessWidget {
  MyBody({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      // 宽高铺满屏幕
      height: MediaQuery.of(context).size.height,
      width: MediaQuery.of(context).size.width,
      color: const Color.fromARGB(255, 175, 223, 177),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          IconContainer(
            MyFont.pokemonBall,
            iconColor: Colors.white,
          ),
          IconContainer(
            MyFont.pikachu,
            bgColor: Colors.blue,
          ),
        ],
      ),
    );
  }
}

class IconContainer extends StatelessWidget {
  final Color bgColor;
  final Color iconColor;
  final IconData icon;
  IconContainer(this.icon,
      {super.key, this.bgColor = Colors.red, this.iconColor = Colors.yellow});

  @override
  Widget build(BuildContext context) {
    return Container(
        alignment: Alignment.center,
        height: 150,
        width: 150,
        color: bgColor,
        child: Icon(
          icon,
          color: iconColor,
          size: 80,
        ));
  }
}
